light6 2.2.0
Loading...
Searching...
No Matches
light6.h File Reference

This file contains API for Light 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  light6_t
 Light 6 Click context object. More...
struct  light6_cfg_t
 Light 6 Click configuration object. More...

Macros

#define LIGHT6_REG_ALS_CONF   0x00
 Light 6 register list.
#define LIGHT6_REG_ALS_THDH_L   0x04
#define LIGHT6_REG_ALS_THDH_H   0x05
#define LIGHT6_REG_ALS_THDL_L   0x06
#define LIGHT6_REG_ALS_THDL_H   0x07
#define LIGHT6_REG_ALS_DATA_L   0x10
#define LIGHT6_REG_ALS_DATA_H   0x11
#define LIGHT6_REG_IR_DATA_L   0x12
#define LIGHT6_REG_IR_DATA_H   0x13
#define LIGHT6_REG_VEML6031X01_ID_L   0x14
#define LIGHT6_REG_VEML6031X01_ID_H   0x15
#define LIGHT6_REG_INT_FLAG   0x17
#define LIGHT6_ALS_CONFIG_ALS_IT_3_125_MS   0x0000
 Light 6 als config setting.
#define LIGHT6_ALS_CONFIG_ALS_IT_6_25_MS   0x1000
#define LIGHT6_ALS_CONFIG_ALS_IT_12_5_MS   0x2000
#define LIGHT6_ALS_CONFIG_ALS_IT_25_MS   0x3000
#define LIGHT6_ALS_CONFIG_ALS_IT_50_MS   0x4000
#define LIGHT6_ALS_CONFIG_ALS_IT_100_MS   0x5000
#define LIGHT6_ALS_CONFIG_ALS_IT_200_MS   0x6000
#define LIGHT6_ALS_CONFIG_ALS_IT_400_MS   0x7000
#define LIGHT6_ALS_CONFIG_ALS_IT_MASK   0x7000
#define LIGHT6_ALS_CONFIG_ALS_MODE_AUTO   0x0000
#define LIGHT6_ALS_CONFIG_ALS_MODE_ACTIVE_FORCE   0x0800
#define LIGHT6_ALS_CONFIG_ALS_MODE_MASK   0x0800
#define LIGHT6_ALS_CONFIG_ALS_TRIGGER_OFF   0x0000
#define LIGHT6_ALS_CONFIG_ALS_TRIGGER_ON   0x0400
#define LIGHT6_ALS_CONFIG_ALS_TRIGGER_MASK   0x0400
#define LIGHT6_ALS_CONFIG_ALS_INT_OFF   0x0000
#define LIGHT6_ALS_CONFIG_ALS_INT_ON   0x0200
#define LIGHT6_ALS_CONFIG_ALS_INT_MASK   0x0200
#define LIGHT6_ALS_CONFIG_ALS_ON_TURN_ON   0x0000
#define LIGHT6_ALS_CONFIG_ALS_ON_TURN_OFF   0x0180
#define LIGHT6_ALS_CONFIG_ALS_ON_MASK   0x0180
#define LIGHT6_ALS_CONFIG_ALS_PDDIV_4_4_PD   0x0000
#define LIGHT6_ALS_CONFIG_ALS_PDDIV_1_4_PD   0x0040
#define LIGHT6_ALS_CONFIG_ALS_PDDIV_MASK   0x0040
#define LIGHT6_ALS_CONFIG_ALS_GAIN_X1   0x0000
#define LIGHT6_ALS_CONFIG_ALS_GAIN_X2   0x0008
#define LIGHT6_ALS_CONFIG_ALS_GAIN_X0_66   0x0010
#define LIGHT6_ALS_CONFIG_ALS_GAIN_X0_5   0x0018
#define LIGHT6_ALS_CONFIG_ALS_GAIN_MASK   0x0018
#define LIGHT6_ALS_CONFIG_ALS_PERS_1   0x0000
#define LIGHT6_ALS_CONFIG_ALS_PERS_2   0x0002
#define LIGHT6_ALS_CONFIG_ALS_PERS_4   0x0004
#define LIGHT6_ALS_CONFIG_ALS_PERS_8   0x0006
#define LIGHT6_ALS_CONFIG_ALS_PERS_MASK   0x0006
#define LIGHT6_ALS_CONFIG_ALS_CAL_OFF   0x0000
#define LIGHT6_ALS_CONFIG_ALS_CAL_ON   0x0001
#define LIGHT6_ALS_CONFIG_ALS_CAL_MASK   0x0001
#define LIGHT6_INT_FLAG_AF_DATA_READY   0x08
 Light 6 INT flag register setting.
#define LIGHT6_INT_FLAG_ALS_IF_L   0x04
#define LIGHT6_INT_FLAG_ALS_IF_H   0x02
#define LIGHT6_DEVICE_ID   0x0001
 Light 6 device ID setting.
#define LIGHT6_ALS_MIN_RES   0.002568f
 Light 6 ALS minimal resolution setting.
#define LIGHT6_ALS_CONFIG_DEFAULT
 Light 6 default setting.
#define LIGHT6_THRESHOLD_LOW_DEFAULT   0x0000
#define LIGHT6_THRESHOLD_HIGH_DEFAULT   0x0000
#define LIGHT6_DEVICE_ADDRESS   0x29
 Light 6 device address setting.
#define LIGHT6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  light6_return_value_t { LIGHT6_OK = 0 , LIGHT6_ERROR = -1 }
 Light 6 Click return value data. More...

Functions

void light6_cfg_setup (light6_cfg_t *cfg)
 Light 6 configuration object setup function.
err_t light6_init (light6_t *ctx, light6_cfg_t *cfg)
 Light 6 initialization function.
err_t light6_default_cfg (light6_t *ctx)
 Light 6 default configuration function.
err_t light6_generic_write (light6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Light 6 I2C writing function.
err_t light6_generic_read (light6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Light 6 I2C reading function.
uint8_t light6_get_int_pin (light6_t *ctx)
 Light 6 get INT pin function.
err_t light6_check_communication (light6_t *ctx)
 Light 6 Check Communication function.
err_t light6_set_als_config (light6_t *ctx, uint16_t config)
 Light 6 Set ALS Configuration function.
err_t light6_get_als_config (light6_t *ctx, uint16_t *config)
 Light 6 Get ALS Configuration function.
err_t light6_set_als_threshold (light6_t *ctx, uint16_t threshold_low, uint16_t threshold_high)
 Light 6 Set ALS Threshold function.
err_t light6_get_als_threshold (light6_t *ctx, uint16_t *threshold_low, uint16_t *threshold_high)
 Light 6 Get ALS Threshold function.
err_t light6_get_int_flag (light6_t *ctx, uint8_t *int_flag)
 Light 6 Get Interrupt Flag function.
err_t light6_get_raw_data (light6_t *ctx, uint16_t *als_data, uint16_t *ir_data)
 Light 6 Get Raw Data function.
err_t light6_get_data (light6_t *ctx, float *als_data, uint16_t *ir_data)
 Light 6 Get Processed Data function.

Detailed Description

This file contains API for Light 6 Click Driver.

Enumeration Type Documentation

◆ light6_return_value_t

Light 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
LIGHT6_OK 
LIGHT6_ERROR